package com.taotao.web.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.fasterxml.jackson.core.type.TypeReference;
import com.taotao.common.service.HttpClientService;
import com.taotao.web.pojo.User;

@Service
public class UserService {

	@Autowired
	private HttpClientService httpClientService;
	
	@Value("${TAOTAO_SSO_QUERY_TOKEN}")
	private String TAOTAO_SSO_QUERY_TOKEN;
	
	public User queryUserByToken(String token){
		return this.httpClientService.doGet(TAOTAO_SSO_QUERY_TOKEN + token + ".html", new TypeReference<User>() {
		});
	}
}
